int cmp_int(const void* e1,const void* e2)
{
    return *(int*)e1 - *(int*)e2;
}
double findMedianSortedArrays(int* nums1, int nums1Size, int* nums2, int nums2Size)
{
    int sum = nums1Size+nums2Size;
    int arr[sum];
    int* p=arr;
    int a=0;
    int b=0;
    double result=0;
    for(int i=0;i<sum;i++)
    {
        if(i<nums1Size)
        {
            arr[i] = *(nums1+a);
            a++;
        }
        else
        {
            arr[i] = *(nums2+b);
            b++;
        }
    }
    qsort(arr,sum,4,cmp_int);
    if(sum % 2 ==0)
    {
        sum /=2;
        while(sum--)
        {
            p++;
        }
        result = (double)(*(p-1) + *(p)) /2;
    }
    else
    {
        sum /=2;
        while(sum--)
        {
            p++;
        }
        result = (double)(*p);
    }
    return result;
}